package com.zp.master.modules.impl;

import com.github.pagehelper.PageInfo;
import com.zp.master.modules.dao.SysUserDao;
import com.zp.master.modules.entity.SysUser;
import com.zp.master.modules.service.SysUserService;
import com.zp.master.modules.vo.UserConditionVO;
import org.apache.shiro.util.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;


@Service(value = "SysUserService")
public class SysUserImpl implements SysUserService {

    @Autowired
    private SysUserDao sysUserDao;

    @Override
    public SysUser insert(SysUser entity) {
        return null;
    }

    @Override
    public void insertList(List<SysUser> entities) {

    }

    @Override
    public boolean removeByPrimaryKey(Long primaryKey) {
        return false;
    }

    @Override
    public boolean update(SysUser entity) {
        return false;
    }

    @Override
    public boolean updateSelective(SysUser entity) {
        return false;
    }

    @Override
    public SysUser getByPrimaryKey(Long primaryKey) {
        return null;
    }

    @Override
    public SysUser getOneByEntity(SysUser entity) {
        return null;
    }

    /**
     * 查询所有用户信息
     *
     * @return
     */
    @Override
    public List<SysUser> listAll() {
        List<SysUser> sysUserList = sysUserDao.selectAll();

        if (CollectionUtils.isEmpty(sysUserList)) {
            return null;
        }

        List<SysUser> users = new ArrayList<SysUser>();
        for (SysUser sysUser : sysUserList) {
            users.add(sysUser);
        }
        return users;
    }

    @Override
    public List<SysUser> listByEntity(SysUser entity) {
        return null;
    }


    @Override
    public SysUser getUserByUserName(String name) {
        SysUser sysUser = sysUserDao.get(name);
        return sysUser;
    }

    @Override
    public PageInfo<SysUser> findPageBreakByCondition(UserConditionVO vo) {
        return null;
    }

    @Override
    public SysUser updateUserLastLoginInfo(SysUser user) {
        return null;
    }

    @Override
    public SysUser getByUserName(String userName) {
        return null;
    }

    @Override
    public List<SysUser> listByRoleId(Long roleId) {
        return null;
    }
}
